home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Tools - Objects / Macintosh Programmer’s Workshop / MPW 3.1 / SADE 1.1 / SADEScripts / DisplayMemory next >
Text File  |  1990-12-13  |  902b  |  47 lines

  1. #    Symbolic Application Debugging Environment    1.0 Final
  2. #
  3. #    Copyright Apple Computer, Inc. 1987-1988
  4. #    All rights reserved.
  5.  
  6. ###############################################################################
  7. #### Dm addr [, count] == memory display in hex and ASCII
  8.  
  9. proc dm a,n        # display memory from address a for n bytes [default n = 16]
  10.     define i, j, b, s := ''
  11.     If undef(n) then
  12.         n := 16
  13.     end
  14.     for i := 1 to n do
  15.         if (i mod 16) = 1 then
  16.             if s <> '' then
  17.                 printf " '%t'", s
  18.             end
  19.             if i <> 1 then
  20.                 printf "\n"
  21.             end
  22.             printf "%.8X: ", a
  23.             s := ''
  24.         end
  25.         b := ^unsignedByte(a)^
  26.         printf "%.2X ", b
  27.         if (b < $20) | (b > $7E) then
  28.             s := concat(s, '.')
  29.         else
  30.             s := concat(s, cChar(b))
  31.         end
  32.         a := a + 1
  33.     end
  34.     if s <> '' then
  35.       if i > 16 then
  36.             i := i mod 16
  37.             if i <> 0 then
  38.                 for j := i to 15 do
  39.                     printf "   "
  40.                 end
  41.             end
  42.         end
  43.         printf " '%t'", s
  44.     end
  45.     printf "\n"
  46. end
  47.